//============================================================================
// Copyright (C) 2009-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
 
// example class for pkt handler ease of coding
#include "RcSysSktMgrLib.h"

//=== constructor ===//
RcSysPktHandler::RcSysPktHandler()
{
	for( int i = 0; i <= sizeof( m_aBaseSysPktFuncTable ) / sizeof( void * ); i++ )
	{
		m_aBaseSysPktFuncTable[ i ] = &RcSysPktHandler::OnPktUnhandled;
	}
	m_aBaseSysPktFuncTable[ 0 ] = &RcSysPktHandler::OnPktInvalid;
 
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_DIE & 0xff) ]					= &RcSysPktHandler::OnPktDie;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_AUTH & 0xff) ]					= &RcSysPktHandler::OnPktAuth;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_ANN_LIST & 0xff) ]				= &RcSysPktHandler::OnPktAnnList;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_ANNOUNCE & 0xff) ]				= &RcSysPktHandler::OnPktAnnounce;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_FIND_NODE & 0xff) ]			= &RcSysPktHandler::OnPktFindNode;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_OFFER_SYSTEM_MSG & 0xff) ]		= &RcSysPktHandler::OnPktOfferSystemMsg;
	//m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_OFFER_PLUGIN & 0xff) ]			= &RcSysPktHandler::OnPktOfferPlugin;
	//	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_OFFER_STATUS & 0xff) ]			= &RcSysPktHandler::PktOfferStatus;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_ANN_APP_UPDATE & 0xff) ]		= &RcSysPktHandler::OnPktAnnTronacomUpdate;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_PATCH & 0xff) ]				= &RcSysPktHandler::OnPktPatch;
	//m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_NODE_LIST & 0xff) ]			= &RcSysPktHandler::OnPktNodeList;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_PING & 0xff) ]					= &RcSysPktHandler::OnPktPing;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_PONG & 0xff) ]					= &RcSysPktHandler::OnPktPong;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_PROXY_SERVICE_REQ & 0xff) ]	= &RcSysPktHandler::OnPktRelayServiceReq;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_PROXY_SERVICE_REPLY & 0xff) ]	= &RcSysPktHandler::OnPktRelayServiceReply;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_PROXY_CONNECT_REQ & 0xff) ]	= &RcSysPktHandler::OnPktRelayConnectReq;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_PROXY_CONNECT_REPLY & 0xff) ]	= &RcSysPktHandler::OnPktRelayConnectReply;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_PROXY_USER_DISCONNECT & 0xff) ]= &RcSysPktHandler::OnPktRelayUserDisconnect;


	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_SEARCH_REQ & 0xff) ]			= &RcSysPktHandler::OnPktSearchReq;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_SEARCH_REPLY & 0xff) ]			= &RcSysPktHandler::OnPktSearchReply;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_FIND_FILE_REQ & 0xff) ]		= &RcSysPktHandler::OnPktFindFileReq;
	m_aBaseSysPktFuncTable[ (RC_SYS_PKT_TYPE_FIND_FILE_REPLY & 0xff) ]		= &RcSysPktHandler::OnPktFindFileReply;
}

//=== destructor ===//
RcSysPktHandler::~RcSysPktHandler()
{
}



